import { Controller, Get, SetMetadata } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  getHello(): string {
    return this.appService.getHello();
  }

  // @SetMetadata('require-login', true)
  @Get('test')
  async test() {
    try {
      return { data: 'test!' };
    } catch (e) {
      console.log(e);
      return '上传失败';
    }
  }
}
